import React, { Component } from 'react';
import {
  StyleSheet,
  WebView,
  ActivityIndicator,
} from 'react-native';

export default class Web extends Component {
  componentWillMount() {
    this.$emit('labMalShow');
  }
  // componentWillUpdate() {
  //   this.$emit('labMalShow');
  // }
  onLoad() {
    this.$emit('labMalHide');
  }
  render() {
    return (
      <WebView
        style={styles.wv}
        onLoad={() => { this.onLoad() }}
        source={{uri: 'https://www.baidu.com'}}
      />
    )
  }
}

const styles = StyleSheet.create({
  wv: {
    marginLeft: 'auto',
    marginRight: 'auto',
    width: '80%',
    height: '100%', // 暂时无效，需探索
    backgroundColor: '#000',
  },
});